<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
          /* 开启了定位的元素 */
      /* margin-left+padding-left+left+center+margin-right+padding-right+right='父元素的宽度' */
      /* ，没开启定位的元素 */
      /*margin-left+padding-left+center+margin-right+padding-right='父元素的宽度'*/
    .outer{
      display: flex;
      height: 200px;
      /* position: relative; */
    }
    /* 方式一： 开启浮动 */
    /* .left {
      float: left;
      width: 200px;
      height: 100%;
      background-color: antiquewhite;
    }
    .right{
      height: 100%;;
      text-align: center;
      background-color: aqua;
    } */
    /* 方式二 :给左边元素开启绝对定位，右边宽度自适应*/
    /* .left {
      position: absolute;
      width: 200px;
      height: 100%;
      background-color: antiquewhite;
    }
    .right{
      height: 100%;
      margin-left: 200px;
      text-align: center;
      background-color: aqua;
    }  */
    /* 方式三：给右边元素开启绝对定位 */
    /* .left {
      width: 200px;
      height: 100%;
      background-color: antiquewhite;
    }
    .right{
      position: absolute;
      left: 200px;
      top: 0;
      right: 0;
      height: 100%;
      text-align: center;
      background-color: aqua;
    }  */
    /* 方式四：父元素开启flex */
    .left {
      width: 200px;
      /* flex-basis: 200px; */
      height: 100%;
      background-color: antiquewhite;
    }
    .right{
      flex: 1;
      text-align: center;
      background-color: aqua;
    } 
  </style>
</head>
<body>
  <div class="outer">
    <div class="left">左侧</div>
    <div class="right">右侧</div>
  </div>
</body>
</html>